import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/classes_config_entity.dart';

ClassesConfigEntity $ClassesConfigEntityFromJson(Map<String, dynamic> json) {
  final ClassesConfigEntity classesConfigEntity = ClassesConfigEntity();
  final String? classesBeginDate = jsonConvert.convert<String>(json['classesBeginDate']);
  if (classesBeginDate != null) {
    classesConfigEntity.classesBeginDate = classesBeginDate;
  }
  final String? classesColor = jsonConvert.convert<String>(json['classesColor']);
  if (classesColor != null) {
    classesConfigEntity.classesColor = classesColor;
  }
  final String? classesEndDate = jsonConvert.convert<String>(json['classesEndDate']);
  if (classesEndDate != null) {
    classesConfigEntity.classesEndDate = classesEndDate;
  }
  final String? classesName = jsonConvert.convert<String>(json['classesName']);
  if (classesName != null) {
    classesConfigEntity.classesName = classesName;
  }
  final String? classesType = jsonConvert.convert<String>(json['classesType']);
  if (classesType != null) {
    classesConfigEntity.classesType = classesType;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    classesConfigEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    classesConfigEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    classesConfigEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    classesConfigEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    classesConfigEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    classesConfigEntity.id = id;
  }
  final int? totalTime = jsonConvert.convert<int>(json['totalTime']);
  if (totalTime != null) {
    classesConfigEntity.totalTime = totalTime;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    classesConfigEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    classesConfigEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    classesConfigEntity.updateDate = updateDate;
  }
  return classesConfigEntity;
}

Map<String, dynamic> $ClassesConfigEntityToJson(ClassesConfigEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['classesBeginDate'] = entity.classesBeginDate;
  data['classesColor'] = entity.classesColor;
  data['classesEndDate'] = entity.classesEndDate;
  data['classesName'] = entity.classesName;
  data['classesType'] = entity.classesType;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['totalTime'] = entity.totalTime;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension ClassesConfigEntityExtension on ClassesConfigEntity {
  ClassesConfigEntity copyWith({
    String? classesBeginDate,
    String? classesColor,
    String? classesEndDate,
    String? classesName,
    String? classesType,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    int? totalTime,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return ClassesConfigEntity()
      ..classesBeginDate = classesBeginDate ?? this.classesBeginDate
      ..classesColor = classesColor ?? this.classesColor
      ..classesEndDate = classesEndDate ?? this.classesEndDate
      ..classesName = classesName ?? this.classesName
      ..classesType = classesType ?? this.classesType
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..totalTime = totalTime ?? this.totalTime
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
